home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / pdf2ps < prev    next >
Encoding:
Text File  |  2006-11-28  |  840 b   |  34 lines

  1. #!/bin/sh
  2. # $Id: pdf2ps 6300 2005-12-28 19:56:24Z giles $
  3. # Convert PDF to PostScript.
  4.  
  5. # This definition is changed on install to match the
  6. # executable name set in the makefile
  7. GS_EXECUTABLE=gs
  8.  
  9. OPTIONS=""
  10. while true
  11. do
  12.     case "$1" in
  13.     -?*) OPTIONS="$OPTIONS $1" ;;
  14.     *)  break ;;
  15.     esac
  16.     shift
  17. done
  18.  
  19. if [ $# -eq 2 ] 
  20. then
  21.     outfile=$2
  22. elif [ $# -eq 1 ]
  23. then
  24.     outfile=`basename "$1" \.pdf`.ps
  25. else
  26.     echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
  27.     exit 1
  28. fi
  29.  
  30. # Doing an initial 'save' helps keep fonts from being flushed between pages.
  31. # We have to include the options twice because -I only takes effect if it
  32. # appears before other options.
  33. exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
  34.